<body>
<div class="path fn-clear"><span class="fb">首页</span><a href="{url('module/index')}">模型管理</a><a href="{url('module/field',array(id=>$info['id']))}">模型《{$info['name']}》管理</a></div>
<div class="button-nav">
  <a href="{url('module/fieldadd',array(id=>$info['id']))}" class="button button-blank link" title="增加字段"><i class="iconfont" title="增加字段">&#xF023;</i> 增加字段</a>
</div>
<div class="m5">
<table class="table table-bordered table-striped" width="100%">
<thead><tr><th class="fn-tac w20">#</th><th class="fn-tal">字段标识</th><th class="fn-tac w150">字段名</th><th class="fn-tac w100">字段类型</th><th class="fn-tac w120">创建时间</th><th class="fn-tac w40">排序</th><th class="fn-tac w80">操作</th></tr></thead>
<tbody>
{loop $list $vo}
<tr>
    <td class="fn-tac">{$vo['id']}</td>
    <td><a href="{url('module/fieldedit',array(id=>$vo['id']))}" title="编辑">{$vo['name']}</a></td>
    <td class="fn-tac w150">{$vo['fields']}</td>
    <td class="fn-tac w100"><?php 
          switch($vo['type']) {
          case 1:        
                echo '单行文本';
                break;
          case 2:        
                echo '多行文本';
                break;
          case 3:        
                echo '编辑器';
                break;
          case 4:        
                echo '下拉列表';
                break;
          case 5:        
                echo '单选框';
                break;
          case 6:        
                echo '复选框';
                break;
          case 7:        
                echo '整形数字';
                break;          
          case 8:        
                echo '货币(保留2位小数)';
                break;
          }
          ?></td>
    <td class="fn-tac">{date('Y-m-d H:i:s',$vo['uptime'])}</td>
    <td class="fn-tac"><input fid="{$vo['id']}" name="sorter" class="input w40 fn-tac" type="text" value="{$vo['neworder']}" /></td>
    <td class="fn-tac tip"><a href="{url('module/fieldedit',array(id=>$vo['id']))}" title="编辑">编辑</a>/<a class="del" href="###" url="{url('module/field',array(id=>$vo['id'],act=>'del'))}"  title="删除">删除</a>
    </td>
</tr>
{/loop}
</tbody>
</table>
</div>
<script language="javascript">
Do('base','Dialog',function(){
    $("input[name='sorter']").blur(function(){
        var id = $(this).attr('fid');
        var sid = $(this).val();
        $.post('{url('module/uporter')}',{id:id,sorter:sid})
    });
    $('.del').click(function(){
        $(this).cpDelete();
    });
})
</script>
</body>